<template lang="jade">
div.index-list
  div#item_page
    div.info
      div.item
        b 标的总额
        strong {{item.account}}
        span 万元
      div.item
        b 约定收益率
        strong {{item.borrow_apr_left}}
        span .{{item.borrow_apr_right}}%
      div.item
        b 借款期限
        strong {{item.borrow_period}}
        span {{item.borrow_period_str}}
  ul.list
    li(v-for="(index, obj) in info")

      div.item-box
        h3 {{obj.name}}
        h4 {{obj.status_str}}
        div.type
          span 足值抵押
          span 抵押登记
      div.info
          div.item
            b 标的总额
            strong {{obj.account}}
            span 万元
          div.item
            b 约定收益率
            strong {{obj.borrow_apr_left}}
            span .{{obj.borrow_apr_right}}%
          div.item
            div.bubble
              em {{obj.borrow_account_wait}}
              em 还可投
  router-view
  
</template>

<script>
import {Api_Index} from '../../config/api'

export default {

  data () {
    return {
      itemId: '',
      info: '',
      item: '',
    }
  },
  methods: {
    fetch: function (next) {
      var that = this
      this.$http({url: Api_Index+'&name_no='+this.itemId, method: 'GET'}).then(function (response) {
        that.info = response.data.data
        that.item = response.data.sum
        next()
      }, function (response) {
          console.log(response)
      });
    },
  },
  route: {
    activate ( transition ) {
      this.itemId = transition.to.params.itemId
      this.fetch( function() {
        transition.next();
      })
    }
  }
}
</script>
